<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Document</title>
    <style>
        #box{width: 100px;
            height: 100px;
            background: green;
            position: fixed;
            right:30px;top:60px;}
            //d大婶 大婶大婶大婶的
    </style>
</head>

<body>
<div id="box"></div>
<button on></button><button></button><button></button>
</body>
</html>
<script>
    var div = document.getElementById('box');
    window.onscroll = function(){
         var scrollTop = document.documentElement.scrollTop

    }

    window.onbeforeunload = function(){


        var flag = confirm('你确定离开么');


        return flag;
    }



</script>
